@echo off
setlocal enabledelayedexpansion

set commands[0]=%DART_HOME%\pub run build_runner build
set commands[1]=%FLUTTER_HOME%\flutter packages pub run build_runner build --delete-conflicting-outputs
set commands[2]=%FLUTTER_HOME%\flutter packages pub run build_runner watch
set commands[3]=pub global run intl_utils:generate
set commands[4]=iconfont_builder --from ./fonts --to ./lib/iconfont.dart --focus true
set commands[5]=agen -w --no-watch -s --no-save -c Res

set "count=0"
:SymLoop
if defined commands[%count%] (
   set /a "count+=1"
   GOTO :SymLoop
)
set /a "count-=1"

echo Your DART_HOME: %DART_HOME%
echo Your FLUTTER_HOME: %FLUTTER_HOME%
echo.
echo Please select a command.
echo ==============================
for /l %%n in (0,1,%count%) do (
   echo %%n^) !commands[%%n]!
)
echo ==============================
echo.

set /p command_id=Enter command id:
call !commands[%command_id%]!